<template>
  <div style="line-height: 34px !important;">
    <el-button v-if="params.data.passwordType === '1' && isAuth('examinee:list:edit')" title="需要密码" icon="icon iconfont icon-mimabianji" type="primary" circle size="small"
      @click="passwordEdit(params.data.row)"></el-button>
    <el-button v-if="params.data.passwordType !== '1' && isAuth('examinee:list:edit')" title="编辑" icon="icon iconfont icon-bianji" type="primary" circle size="small"
      @click="edit(params.data.row)"></el-button>
    <el-button v-if="params.data.passwordType === '1' && isAuth('examinee:list:view')" type="warning" title="通过密码查看学生列表" circle size="small" @click.stop="viewByPwdHandle">
      <span class="icon iconfont icon-xnmm"></span>
    </el-button>
    <el-button v-if="params.data.passwordType !== '1' && isAuth('examinee:list:view')" type="warning" title="普通查看学生列表" circle size="small" @click.stop="viewHandle">
      <span class="icon iconfont icon-xiangqing"></span>
    </el-button>
    <el-button v-if="params.data.passwordType === '1' && isAuth('examinee:list:import')" type="success" title="通过密码导入学生列表" circle size="small" @click.stop="importByPwdHandle">
      <span class="icon iconfont icon-upload-lock"></span>
    </el-button>
    <el-button v-if="params.data.passwordType !== '1' && isAuth('examinee:list:import')" type="success" title="普通导入学生列表" circle size="small" @click.stop="importHandle">
      <span class="icon iconfont icon-shangchuan"></span>
    </el-button>
    <el-button v-if="params.data.passwordType === '1' && isAuth('examinee:list:delete')" type="danger" title="通过密码删除" circle size="small" @click.stop="delByPwdHandle">
      <span class="icon iconfont icon-shanchuquanxian"></span>
    </el-button>
    <el-button v-if="params.data.passwordType !== '1' && isAuth('examinee:list:delete')" type="danger" title="删除" circle size="small" @click.stop="delHandle">
      <span class="icon iconfont icon-shanchu"></span>
    </el-button>
    <el-button v-if="isAuth('examinee:list:resetPwd')  && params.data.passwordType === '1'" type="warning" title="重置密码" circle size="small" @click.stop="resetItem">
      <span class="icon iconfont icon-zhongzhimima"></span>
    </el-button>
  </div>
</template>
<script>
import Vue from 'vue'
export default Vue.extend({
  // props: ["flag"],
  data () {
    return {}
  },
  methods: {
    viewHandle () {
      this.params.context.componentParent.viewHandle(this.params.data)
    },
    viewByPwdHandle () {
      this.params.context.componentParent.viewByPwdHandle(this.params.data)
    },
    importHandle () {
      this.params.context.componentParent.importHandle(this.params.data)
    },
    importByPwdHandle () {
      this.params.context.componentParent.importByPwdHandle(this.params.data)
    },
    passwordEdit () {
      this.params.context.componentParent.passwordEdit(this.params.data)
    },
    edit () {
      this.params.context.componentParent.edit(this.params.data)
    },
    delHandle () {
      this.params.context.componentParent.delHandle(this.params.data)
    },
    delByPwdHandle () {
      this.params.context.componentParent.delByPwdHandle(this.params.data)
    },
    resetItem () {
      this.params.context.componentParent.resetItem(this.params.data)
    }
  }
})
</script>
